﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="../include/top.jsp" %>
<%@ include file="../include/errorArea.jsp" %>
<div class="section">
<div class='adduser'>
	<div class='adduser-left'><div class='adduser-icon'></div>
	<c:if test="${empty topic.topicId || topic.topicId==0}"><span>添加帖子</span></c:if>
	  <c:if test="${not empty topic.topicId && topic.topicId>0}">编辑帖子</c:if>
	</div>
</div>
<div class="order-list"><form name="myForm" method="POST" action="${baseURL}/forumO2C/saveTopic">
					<input type="hidden" name="topicId" value="${formdata.topicId}" />

<table border="0" align="center" id="listTable" class="order-list-table">
	<tr style="display:none">
	  <td colspan="2" height="0" >
	  </td>
    </tr>
    
    <tr>
		<td align="right">标题：</td>
		<td align="left"><input name="topicTitle" type="text" id="topicTitle"
			value="${formdata.topicTitle}" size="50" maxlength="50"/></td>
	</tr>
	<tr>
		<td align="right"><span class="mustInput">*</span>内容：</td>
		<td align="left">
		 <link rel="stylesheet" href="${baseURL}/kindeditor417/themes/default/default.css" />
			<link rel="stylesheet" href="${baseURL}/kindeditor417/plugins/code/prettify.css" />
			<script charset="utf-8" src="${baseURL}/kindeditor417/kindeditor-all-min.js"></script>
			<script charset="utf-8" src="${baseURL}/kindeditor417/lang/zh_CN.js"></script>
			<script charset="utf-8" src="${baseURL}/kindeditor417/plugins/code/prettify.js"></script>
			<script>
				KindEditor.ready(function(K) {
					editor1 = K.create('textarea[name="topicContent"]', {
						cssPath : '${baseURL}/kindeditor417/plugins/code/prettify.css',
						uploadJson : '${baseURL}/kindeditor417/jsp/upload_json.jsp',
						fileManagerJson : '${baseURL}/kindeditor417/jsp/file_manager_json.jsp',
						allowFileManager : false,
						afterCreate : function() {
							var self = this;
							K.ctrl(document, 13, function() {
								self.sync();
								K('form[name=myForm]')[0].submit();
							});
							K.ctrl(self.edit.doc, 13, function() {
								self.sync();
								K('form[name=myForm]')[0].submit();
							});
						}
					});
					prettyPrint();
				});
			</script>
	  <textarea name="topicContent" cols="60" rows="20" class="myInput" id="topicContent">${formdata.topicContent}</textarea></td>
    </tr>
	<tr>
	  <td colspan="2" align="center">
	  	<input name="submit" type="submit" value="提交" class="myButton"  onclick="editor1.sync()"/>
	    &nbsp;&nbsp;
        <input name="button" type="button"
			onclick="history.go(-1)" value="返回" class="myButton"/></td>
    </tr>
	<tr>
	  <td colspan="4" align="center">&nbsp;</td>
    </tr>
</table>
</form></div>
</div>
<script src="${ctx}/js/buyProduct.js"></script>
<%@ include file="../include/bottom.jsp" %>